package com.news.service.impl;

import com.news.dao.CmsArticleDao;
import com.news.dao.CmsCategoryDao;
import com.news.dao.impl.CmsArticleDaoImpl;
import com.news.dao.impl.CmsCategoryDaoImpl;
import com.news.entity.Article;
import com.news.entity.Category;
import com.news.entity.CategoryParam;
import com.news.service.CmsArticleService;
import com.news.service.CmsCategoryService;

import java.util.List;

/**
 * @Author:weiming
 * @Date:2021/4/19
 */
public class CmsCategoryServiceImpl implements CmsCategoryService {


    private CmsCategoryDao cmsCategoryDao = new CmsCategoryDaoImpl();

    @Override
    public List<Category> getAllCategory() {
        return cmsCategoryDao.getAllCategory();
    }

    @Override
    public List<Category> getAllCategoryCanUse() {
        return cmsCategoryDao.getAllCategoryCanUse();
    }

    @Override
    public int add(Category category) {
        return cmsCategoryDao.add(category);
    }

    @Override
    public int delete(int categoryId) {
        return cmsCategoryDao.delete(categoryId);
    }

    @Override
    public int update(Category category) {
        return cmsCategoryDao.update(category);
    }

    @Override
    public List<CategoryParam> getCategoryWithChild() {
        return cmsCategoryDao.getCategoryWithChild();
    }
}
